package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
public class Customer {
    private Long id;

    private String name;

    private Integer age;

    private Integer gender;

    private String tel;

    private String qq;

    private SystemDictionaryItem job;//职业

    private SystemDictionaryItem source;//来源

    private Employee seller;//营销人员

    private Employee inputUser;//录入人员

    private Date inputTime;//录入时间

    //private Integer status;
    public static final Integer STATUS_POTENTIAL = 0;
    public static final Integer STATUS_FORMAL = 1;
    public static final Integer STATUS_POOL = 2;
    public static final Integer STATUS_FAILED = 3;
    public static final Integer STATUS_LOSS = 4;

    //0:潜在客户
    private Integer status = STATUS_POTENTIAL;


    public String getJsonString(){
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("age",age);
        map.put("gender",gender);
        map.put("tel",tel);
        map.put("qq",qq);
        map.put("jobId",job.getId());
        map.put("sourceId",source.getId());
        map.put("sellerId",seller.getId());
        map.put("sellerName",seller.getName());//旧营销人员姓名
        return JSON.toJSONString(map);
    }

}